import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login',
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    redirect:'/dashboard',
    children: [
      {
        path: '/dashboard',
        name: 'Dashboard',
        component:()=>import('../views/Dashboard.vue')
      },
      {
        path: '/user',
        name:'User',
        component:()=>import('../views/User.vue')
      },
      {
        path: '/shops',
        name: 'Shops',
        component:()=>import('../views/Shops.vue')
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
